﻿@{
    List<KeppelLand.Entities.Claim> claimList = PageData[0];
    KeppelLand.Entities.ClaimSummary claimSummary = PageData[1];
}

@if ((claimList != null) && (claimList.Count > 0))
{
    @*<h2>Claims pending submission</h2>*@
    
    <table class="table table-striped table-bordered" id="pending_submission_claim_list">
        <thead>
            <tr>
                <td colspan="8"></td>
                <td colspan="5" class="text-nowrap" style="font-weight:bold; color:red;">No of overtime hours worked(excl. breaks)</td>
                <td colspan="5"></td>
            </tr>
            <tr>
                <th rowspan="2" style="width:136px">Claim Date</th>
                <th rowspan="2" style="width:90px">Shift Type <br />(for shift staff only)</th>
                <th colspan="2" class="text-center">Official Hours</th>
                <th colspan="2" style="width:1px" class="text-center">Overtime Hours</th>
                <th rowspan="2" style="width:55px" class="text-center">Total OT Hours</th>
                <th rowspan="2" style="width:55px" class="text-center">Break Hours</th>
                <th colspan="2" class="text-center">OT Rate <span class="glyphicon glyphicon-info-sign" style="color:black;font-size:large;cursor:pointer;vertical-align:middle;" title="Information" aria-hidden="true" onclick="javascript: $('#otRateModal').modal('show');"></span></th>
                <th rowspan="2" style="width:1px;cursor:default;" title="Public Holiday">PH</th>
                <th colspan="2" class="text-center" style="white-space:nowrap;">Rest Day</th>
                <th rowspan="2" style="width:90px;">Meal Allw($) <span class="glyphicon glyphicon-info-sign" style="color:black;font-size:large;cursor:pointer;vertical-align:middle;" title="Information" aria-hidden="true" onclick="javascript: $('#mealAllwModal').modal('show');"></span></th>
                <th rowspan="2" style="width:90px;"><span class="text-nowrap">Shift Allw($)</span><br />(for shift staff only)</th>
                <th rowspan="2">Description of Work Performed During Overtime Hours Worked</th>

                <th rowspan="2" style="width:86px;white-space:nowrap !important;">Status</th>
                <th rowspan="2" style="width:86px;">Process Month</th>
            </tr>
            <tr>
                <th style="white-space:nowrap;width:82px;">Start Time</th>
                <th style="white-space:nowrap;width:82px;">End Time&nbsp;</th>
                <th style="white-space:nowrap;">Start Time</th>
                <th style="white-space:nowrap;">End Time&nbsp;</th>
                <th style="width:86px;white-space:nowrap;">1.5 X</th>
                <th style="width:86px;white-space:nowrap;">2.0 X</th>
                <th style="width:36px;">&lt;4</th>
                <th style="width:36px;">&gt;4</th>
            </tr>
        </thead>
        <tbody>
            @foreach (KeppelLand.Entities.Claim c in claimList)
        {
            <tr>
                <td style="white-space:nowrap;">@DisplayHelper.FormatDate(c.ClaimDate) (@DisplayHelper.FormatDayOfWeek(c.ClaimDate))</td>
                <td>@c.ShiftType</td>
                <td >@DisplayHelper.FormatTime(c.StartWorkTime)</td>
                <td >@DisplayHelper.FormatTime(c.EndWorkTime)</td>
                <td >@DisplayHelper.FormatTime(c.StartOverTime)</td>
                <td >@DisplayHelper.FormatTime(c.EndOverTime)</td>
                <td class="text-right">@c.TotalOTHours</td>
                <td class="text-right">@c.BreakHours</td>
                <td class="text-right">@DisplayHelper.FormatDecimal(c.OT1_5)</td>
                <td class="text-right">@DisplayHelper.FormatDecimal(c.OT2_0)</td>
                <td style="text-align:center;">@DisplayHelper.FormatCheckmark(c.PH)</td>
                <td style="text-align:center;">@DisplayHelper.FormatCheckmark(c.RD4)</td>
                <td style="text-align:center;">@DisplayHelper.FormatCheckmark(c.RD8)</td>
                <td class="text-right">@DisplayHelper.FormatMoney(c.AlwMeal)</td>
                <td class="text-right">@DisplayHelper.FormatMoney(c.AlwShft)</td>

                <td>@c.Remark</td>
                <td>@KeppelLand.Helpers.TranslationHelper.GetClaimStatus(c.Status)</td>
                <td>@DisplayHelper.FormatMonth(c.HRClearedDate)</td>
            </tr>
        }
        </tbody>
        @if (claimSummary != null)
    {
        <tfoot>
            <tr>
                <th colspan="6" class="text-right">Total </th>
                <td class="text-right">@DisplayHelper.FormatDecimal(claimSummary.Total_OT_Hours)</td>
                <td class="text-right">@DisplayHelper.FormatDecimal(claimSummary.Break_Hours)</td>
                <td class="text-right">@DisplayHelper.FormatDecimal(claimSummary.OT1_5)</td>
                <td class="text-right">@DisplayHelper.FormatDecimal(claimSummary.OT2_0)</td>
                <td class="text-center">@DisplayHelper.FormatInteger(claimSummary.PH)</td>
                <td class="text-center">@DisplayHelper.FormatInteger(claimSummary.RD4)</td>
                <td class="text-center">@DisplayHelper.FormatInteger(claimSummary.RD8)</td>
                <td class="text-right">@DisplayHelper.FormatMoney(claimSummary.AlwMeal)</td>
                <td class="text-right">@DisplayHelper.FormatMoney(claimSummary.AlwShft)</td>
                <td colspan="3"></td>
            </tr>
        </tfoot>
    }
    </table>
    
    <div>
        <div class="btn-group">
            <button type="button" class="btn btn-primary btn-download" onclick="download('PDF');"><span class="glyphicon glyphicon-download-alt" aria-hidden="true"></span> Download as PDF</button>
            <button type="button" class="btn btn-primary dropdown-toggle" data-toggle="dropdown" aria-expanded="false">
                <span class="caret"></span>
                <span class="sr-only">Toggle Dropdown</span>
            </button>
            <ul class="dropdown-menu" role="menu">
                <li onclick="download('Excel');"><a href="javascript:void(0);" class="btn-download">Download as Excel</a></li>
                <li onclick="download('WORD');"><a href="javascript:void(0);" class="btn-download">Download as Word</a></li>
                <li onclick="download('IMAGE');"><a href="javascript:void(0);" class="btn-download">Download as TIFF</a></li>
            </ul>
        </div>
    </div>
}
<form method="post" id="approval_form">
    <input type="hidden" name="actionButton" id="actionButton" />
    <input type="hidden" name="actionId" id="actionId" />
    <input type="hidden" name="download_format" id="download_format" />

    <input type="hidden" name="claimStartDate" id="claimStartDate" />
    <input type="hidden" name="claimEndDate" id="claimEndDate" />
    <input type="hidden" name="claimStatus" id="claimStatus" />
</form>

<p>&nbsp;</p>
